//
//  EventItem.m
//  iMADE
//
//  Created by Edward Knutson on 10/23/09.
//  Copyright 2009 Six Four Systems. All rights reserved.
//

#import "EventItem.h"

#import "Convert.h"

@implementation EventItem

@synthesize uid, summary, desc, location, startDate, endDate;

- (id)initWithDictionary:(NSDictionary *)dict {
	if(self = [super init]) {
		self.uid = [dict valueForKey:@"UID"];
		self.summary = [dict valueForKey:@"Summary"];
		self.desc = [dict valueForKey:@"Description"];
		NSString *start = [dict valueForKey:@"StartDate"];
		if(start != nil)
			self.startDate = [Convert dateFromString:start];
		else self.startDate = nil;
		NSString *end = [dict valueForKey:@"EndDate"];
		if(end != nil)
			self.endDate = [Convert dateFromString:end];
		else self.endDate = nil;
	}
	return self;
}

@end
